using System;
using NUnit.Framework;

namespace ComponentTracer.Tests
{
    [TestFixture]
    public class FunctionAsParameterTests
    {
        [Test]
        public void Methoden_Aufruf_ohne_Parameter_wird_getraced()
        {
            var traceOutput = "";
            var service = new Service();

            var tracedService = TracerProxy.Create<IService>(service, s => { traceOutput += s; });
            tracedService.Calc(x => x + 1);

            Assert.That(traceOutput, Is.EqualTo("ComponentTracer.Tests.FunctionAsParameterTests+Service.Calc([])\n"));
        }

        public interface IService
        {
            void Calc(Func<int, int> func);
        }

        public class Service : IService
        {
            public void Calc(Func<int, int> func) {
                
            }
        }
    }
}